<template>
	<div>
		<el-dialog title="选择检验" :visible.sync="dialogVisibleJiLiang" width="1025px" :before-close="handleClose">
			<el-row :gutter="15">
				<el-form class="demo-form-inline" label-width="100px">
					<el-col :span="24">
						<el-form-item label="选择检验项目" style="width:100%;" class="s_selectbox">
							<div class="dialogFirstRow2">
								<el-input v-model="jyVal" :readonly="true" size="mini" style="width:230px;"></el-input>
								<input type="hidden" v-model="jyValCode">
								<el-button type="primary" size="mini" @click="openSelect('检验',jyValCode)">选择</el-button>
								<el-button type="primary" size="mini" @click="clearFun('检验')">清除</el-button>
							</div>
						</el-form-item>
					</el-col>
					<el-col :span="24">
						<el-form-item label="设置审查值" style="width:100%;" class="s_selectbox">
							<div class="dialogFirstRow2">
								<el-select v-model="jy_unequal" size="small" placeholder="请选择审查级别" style="width:70px;">
									<el-option
									  v-for="item in unequalOptions"
									  :key="item.value"
									  :label="item.label"
									  :value="item.value">
									</el-option>
								  </el-select>
								<el-input v-model="jy_value" size="mini" style="width:230px;" class="input"></el-input>
							</div>
						</el-form-item>
					</el-col>
				</el-form> 	
			</el-row>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="sureFun">确认选择</el-button>
				<el-button @click="dialogVisibleJiLiang = false">关 闭</el-button>
			</span>
		</el-dialog>
	</div>
</template>

<script>
	export default {
		props:{
			jyData:{
				type:Object
			},
		},
		watch:{
			jyData(val){
				this.jyVal=val.name;
				this.jyValCode=val.id
			},
		},
		data () {
			return {
				dialogVisibleJiLiang:false,
				jyVal:"",
				jyValCode:"",
				jy_unequal:"0",
				jy_value:"",
				unequalOptions:[
					{
					  value: '0',
					  label: '<'
					},
					{
					  value: '1',
					  label: '<='
					},
					{
					  value: '2',
					  label: '='
					},
					{
					  value: '3',
					  label: '>='
					},
					{
					  value: '4',
					  label: '>'
					},
				]
			}
		},
		methods:{
			handleClose(){
				this.dialogVisibleJiLiang=false
			},
			show(){
				this.dialogVisibleJiLiang=true;
			},
			sureFun(){
				this.$emit("selectFun",{id:this.jyValCode,name:this.jyVal,unequal:this.jy_unequal,value:this.jy_value});
				this.dialogVisibleJiLiang=false;
			},
			openSelect(type,checkId){
				this.$emit("selectPop",type,checkId,1)
			},
			clearFun(){
				this.jyVal="";
				this.jyValCode="";
				this.jy_unequal="0";
				this.jy_value="";
			}
		}
	}
</script>

<style lang="scss" scoped>
	.input{
		height:32px;line-height:32px;
	}
	.dialogFirstRow2>>>.el-input {
		height:32px;line-height:32px;
	}
	
	.el-form-item.s_selectbox>>>.el-form-item__content {
		width: 80%;
	}
	
	
	.demo-form-inline>>>.el-form-item {
		margin-bottom: 0px;
	}
	
	.dialogFirstRow>>>label {
		height:41px;
		display:inline-block;
	}
</style>
